$(function () {
    initEvent();
});

function initEvent() {
    $(".buy").on("click", function () {
        if(session.userInfo){
            var contractId = $(this).attr("contractId");
            window.parent.window.navClickAction(1,"?contractId="+contractId);
        }else{
        window.parent.location.href = webRoot + "/pages/main/login.jsp";
    }

    });
}